home *** CD-ROM | disk | FTP | other *** search
- --= SID = SIMTEL20 Ada Software Repository Item Description File = SID =--
- -- UNIT NAME : generic package GENERIC_MATH_FUNCTIONS
- -- VERSION : 1.0
- -- REVIEW CODE :
- -- DDN ADDRESS : WWHITAKER@ADA20
- -- AUTHOR : Col. William A. Whitaker, Lt. Tim Eicholz, USAF
- -- COPYRIGHT :
- -- DATE CREATED : JULY 1982
- -- DATE RELEASED : JULY 1986
- -- DATE LAST UPDATED : WHITAKER JULY 1986
- -- LOCATION : ASR
- -- ENVIRONMENT : Rational R1000, VAX (DEC), others
- --= CLASSIFICATION ===============================================--
- -- CATEGORY LEVEL 1 : MATH
- -- CATEGORY LEVEL 2 : Library
- -- CATEGORY LEVEL 3 : Cody-Waite
- -- CATEGORY LEVEL 4 :
- -- KEYWORD : MATH
- -- KEYWORD : MATH_FUNCTIONS
- -- KEYWORD : ELEMENTARY_FUNCTIONS
- -- INDEX : Math
- -- INDEX : Math Functions
- -- INDEX : Functions, Math
- -- TAXONOMY :
- -- DEPENDENCIES :
- -- SEE ALSO :
- --= FILE LISTING ===============================================--
- -- FILE SPECS : PD:<ADA.MATH>CODY*.*
- -- DIRECTORY DISPLAY :
- -- Directory PD:<ADA.MATH>
- -- File Name Byte Count Line Count
- -- --------------- ---------- ----------
- -- CODYWAITE.CMM 572 18
- -- CODYWAITE.DOC 13104 251
- -- CODYWAITE.PRO 2504 60
- -- CODYWAITE.SRC 77400 1856
- -- CODYWAITE.TST 106938 3192
- -- =============== ========== ==========
- -- 5 Files 200518 5377
- --= ABSTRACT ===============================================--
- -- A set of elementary math functions (generic on digits <>)
- -- corresponding to the FORTRAN intrinsic functions. The implementation
- -- of the body uses the truncated polynominals method of Cody and Waite.
- -- This is a set of easily understood code ment to be machine
- -- independent. They are not particularly fast. They could be optimized
- -- for particular machines. A fairly extensive set of test procedures
- -- are also provided.
- --
- -- The available functions and constants are:
- --
- --
- -- Pi : constant := 3.14159_26535_89793_23846_26433_83279_50288_41972;
- -- E : constant := 2.71828_18284_59045_23536_02874_71352_66249_77572;
- -- Log_Of_2 : constant := 0.69314_71805_59945_30941_72321_24158_17656_80755;
- -- Log_Of_10 : constant := 2.30258_50929_94045_68401_77914_54684_36420_76011;
- --
- -- function Sign (X, Y : Floating) return Floating;
- -- -- Returns the value of X with the sign of Y
- --
- -- function Max (X, Y : Floating) return Floating;
- -- -- Returns the algebraicly larger of X and Y
- -- function Min (X, Y : Floating) return Floating;
- -- -- Returns the algebraicly smaller of X and Y
- --
- -- function Truncate (X : Floating) return Floating;
- -- -- Returns the floating value of the integer no larger than X
- -- -- Truncates toward zero
- -- function Round (X : Floating) return Floating;
- -- -- Returns the floating value of the integer nearest X
- --
- -- procedure Set_Ran_Key (K : in Floating := Floating (0.0));
- -- -- Can reset the random number generator
- -- function Ran return Floating;
- -- -- A random number between zero and one
- --
- -- function Sqrt (X : Floating) return Floating;
- -- function Cbrt (X : Floating) return Floating;
- -- function Log (X : Floating) return Floating;
- -- function Log10 (X : Floating) return Floating;
- -- function Exp (X : Floating) return Floating;
- -- function "**" (X, Y : Floating) return Floating;
- --
- -- function Sin (X : Floating) return Floating;
- -- function Cos (X : Floating) return Floating;
- -- function Tan (X : Floating) return Floating;
- -- function Cot (X : Floating) return Floating;
- --
- -- function Asin (X : Floating) return Floating;
- -- function Acos (X : Floating) return Floating;
- -- function Atan (X : Floating) return Floating;
- -- function Atan2 (V, U : Floating) return Floating;
- --
- -- function Sinh (X : Floating) return Floating;
- -- function Cosh (X : Floating) return Floating;
- -- function Tanh (X : Floating) return Floating;
- --= REVISION HISTORY ===============================================--
- --
- --
- -- DATE VERSION AUTHOR HISTORY
- -- 18JUL86 1.0 Whitaker Initial Release
- --
- --= RELEASE NOTICE ===============================================--
- --
- -- This software is not subject to copyright.
- --
- -- This software is released to the Ada community.
- -- This software is released to the Public Domain (note:
- -- software released to the Public Domain is not subject
- -- to copyright protection).
- -- Restrictions on use or distribution: NONE
- --
- --= DISCLAIMER ===============================================--
- -- This software and its documentation are provided "AS IS" and
- -- without any expressed or implied warranties whatsoever. No warranties
- -- as to performance, merchantability, or fitness for a particular
- -- purpose exist.
- -- The user is advised to test the software thoroughly before
- -- relying on it. The user must assume the entire risk and liability of
- -- using this software. In no event shall any person or organization of
- -- people be held responsible for any direct, indirect, consequential or
- -- inconsequential damages or lost profits.
- --======================================================================--
-